#pragma once

#include "common/Network.h"
#include "common/Pipeline.h"

namespace nexus {

class ModelUpdater {
 public:
  ModelUpdater(Pipeline& pipeline, Network& network);

  void run();

 private:
  void process(std::shared_ptr<AtomicOverwrite> ao);
  void appendPredicate(std::set<HeaderSpace>& aps, HeaderSpace pred);
  // void computeAPs(std::set<HeaderSpace>& hsset, std::set<HeaderSpace>&
  // apset);
  void findCover(HeaderSpace& hs, std::set<HeaderSpace>& apset,
                 std::set<HeaderSpace>& cover);
  Pipeline& pipeline_;
  Network& network_;
  std::set<HeaderSpace> aps_;
};

}  // namespace nexus